---@class ShopMgr : Object
local ShopMgr = {}
ShopMgr.isLoadShopSkills = false
--浦沅商店
local shop_items = {{"sp_redpotion:::100","sp_bluepotion:::80","sp_recoverpotion:::30","sp_drawpotion:::30"},--药水
{"st_red_spear:::70", "st_quenched_blade:::90", "st_poisonous_dagger:::100", "st_water_sword:::85","st_thunder_blade:::95","st_fm_jingang:::75","st_sw_feijiang:::85","st_xyd_xueyingdao:::90"},--装备
{"skt_ofl_mou__wusheng:::100","skt_ofl_mou__beifa:::81","skt_sxfy__quedi:::120","skt_jianhe:::60","skt_ol_ex__leiji:::100","skt_xionghuo:::30","skt_juewu:::120","skt_ronghuo:::80","skt_os__xiayong:::80",
"skt_mou__tieji:::145","skt_zuowei:::90","skt_zhenqiao:::95","skt_js__zhubei:::70","skt_l_wuqian:::75","skt_wangong:::85","skt_zhihengs:::45","skt_nya__lieren:::65",
"skt_guanjue:::130","skt_ty__baobian:::90","skt_m_ex__dangxian:::130","skt_mini__kuanggu:::140","skt_l_liezhen:::90","skt_baichu:::80","skt_xiongmu:::90","skt_tycl__zhiheng:::85"}, --进攻技能
{"skd_cangxin:::75","skd_ol_ex__weimu:::125","skd_jueyong:::85","skd_xiangle:::60","skd_shoushu:::90","skd_huituo:::65","skd_jishan:::70","skd_zhendan:::55",
"skd_kongcheng:::45","skd_os__liechi:::125","skd_shixin:::50","skd_ol_ex__buqu:::75","skd_m_ex__sidi:::65","skd_mini__keji:::120","skd_os__fupan:::90","skd_ol__zhouxuan:::70",
"skd_lvli:::70","skd_jueqing:::170","skd_jincui:::130","skd_kuangcai:::150","skd_ex__guicai:::65","skd_hanzhan:::60","skd_tianbian:::80","skd_chenglue:::50", 
"skd_tongye:::70","skd_chengxu:::50","skd_ex__longdan:::80","skd_qianxun:::50","skd_ex__qicai:::70","skd_ex__yingzi:::50","skd_yinship:::100","skd_dinghan:::120",
"skd_chongshen:::60","skd_shajue:::120","skd_jiqiaos:::100","skd_ty__weipo:::60","skd_yinshih:::80","skd_taji:::120","skd_qingbei:::100","skd_js__manjuan:::60",
"skd_wentian:::150","skd_mou__qicai:::120","skd_lingce:::80","skd_zhangcai:::210","skd_sijun:::150"},--防御技能
{"spk_basecards:::50","spk_trickcards:::60"},--扩展卡牌包
{"rfe_skills1:::10","rfe_skills2:::20","rfe_skills3:::30"},--刷新技能列表
} 

-- local shop_items_trans = {}进入大厅后只通知qml翻译表刷新一次翻译过于sb
local shop_items_trans = {sp_redpotion = "杀伤翻倍",sp_bluepotion = "锦伤翻倍",sp_recoverpotion = "回满体力",sp_drawpotion = "摸5张牌",
spk_basecards = "补充50张基本牌",spk_trickcards = "补充50张锦囊牌",
st_red_spear = "红缎枪",st_quenched_blade = "烈淬刀",st_poisonous_dagger = "混毒弯匕",st_water_sword = "水波剑",
st_thunder_blade = "天雷刃",st_fm_jingang = "伏魔金刚杵",st_sw_feijiang = "神威飞将剑",st_xyd_xueyingdao = "血影刀",
skt_ofl_mou__wusheng="九鼎武圣",skt_ofl_mou__beifa="九鼎北伐",skt_sxfy__quedi="四象却敌",skt_jianhe="剑合",skt_ol_ex__leiji="OL雷击",
skt_mou__tieji = "谋铁骑",skt_zuowei = "作威",skt_zhenqiao = "振鞘",skt_js__zhubei = "逐北",skt_l_wuqian="浪无前",skt_wangong="挽弓",skt_zhihengs="猘横",skt_nya__lieren="喵烈刃",skd_chengxu="乘虚",
skd_ex__longdan="界龙胆",skd_cangxin="藏心",skt_guanjue="冠绝",skd_ol_ex__weimu="OL界帷幕",skd_jueyong="绝勇",skd_shoushu="授术",skd_huituo="恢拓",skd_jishan="积善",skd_zhendan="镇胆",skd_kongcheng="空城",
skd_os__liechi="烈斥",skd_xiangle="享乐",skd_shixin="释衅",skd_ol_ex__buqu="界不屈",skd_m_ex__sidi="界司敌",skt_xiongmu="雄幕",skt_mini__kuanggu="mini狂骨",skd_mini__keji="mini克己",skt_tycl__zhiheng="制衡",skd_os__fupan="复叛",
skt_l_liezhen="裂阵",skt_baichu="百出",skd_ol__zhouxuan="OL周旋",skd_lvli="膂力",skd_jueqing="绝情",skd_jincui="尽瘁",skt_m_ex__dangxian="界当先",skt_ty__baobian="豹变",skd_kuangcai="新狂才",skd_ex__guicai="界鬼才",
skt_xionghuo="凶镬",skt_juewu="绝武",skt_ronghuo="融火",skt_os__xiayong="狭勇",
skd_hanzhan="酣战",skd_tianbian="天辩",skd_chenglue="成略",skd_tongye="统业",
skd_qianxun="标谦逊",skd_ex__qicai="界奇才",skd_ex__yingzi="界英姿",skd_yinship="手杀隐世",skd_dinghan="定汉",skd_chongshen="重身",skd_shajue="杀绝",skd_jiqiaos="激峭",skd_ty__weipo="新杀危迫",skd_yinshih="新杀隐世",
skd_taji="踏寂",skd_qingbei="擎北",skd_js__manjuan="转包漫卷",skd_wentian="问天",skd_mou__qicai="谋奇才",skd_lingce="灵策",skd_zhangcai="彰才",skd_sijun="肆军",
rfe_skills1="刷新商店",rfe_skills2="刷新商店",rfe_skills3="刷新商店"
}

local shop_trans = {}
local shop_skills = {}
local language = "zh_CN"
for i,items in ipairs(shop_items) do
  for _,item in ipairs(items) do
    local pos = string.find(item,":")
    -- local _pos = string.find(item,"_")
    local trans = string.sub(item,1,pos-1)
    -- local translate = Fk.translations[language][string.sub(item,_pos+1,pos-1)]
    local translate = shop_items_trans[trans]
    if translate then
      shop_trans[trans] = translate.."(%arg金币)"
    end
  end
end
Fk:loadTranslationTable(shop_trans)

ShopMgr.shopitems = shop_items
ShopMgr.shopskills = shop_skills

function ShopMgr:preLoadShopSkills()
  if self.isLoadShopSkills then return end
  for i,items in ipairs(shop_items) do
    if i == 3 or i == 4 then
      for _,item in ipairs(items) do
        local pos = string.find(item,":")
        local skill = Fk.skills[string.sub(item,5,pos-1)]
        if skill then
          table.insertIfNeed(self.shopskills,skill.trueName)
        end
      end
    end
  end
  self.isLoadShopSkills = true
end

function ShopMgr:getShopSkills()
  return ShopMgr.shopskills
end
function ShopMgr:getShopItems()
  return ShopMgr.shopitems
end

return ShopMgr